From: Domas Mituzas Date: Sun, 29 Mar 2009 08:28:13 +0000 (+0000) Subject: I'd love not to do such fixes: X-Git-Tag: 1.31.0-rc.0~42304 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=c8d76b1e626946aec3ae80ec2229ae5e2766259a;p=lhc%2Fweb%2Fwiklou.git I'd love not to do such fixes: * Avoid calculating expensive group error pages (this strips e.g. 25% off Special:RC) --- diff --git a/includes/Title.php b/includes/Title.php index d4bf7c2206..3ce99d80cc 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1015,7 +1015,8 @@ class Title { /** * Can $wgUser perform $action on this page? - * This skips potentially expensive cascading permission checks. + * This skips potentially expensive cascading permission checks + * as well as avoids expensive error formatting * * Suitable for use for nonessential UI controls in common cases, but * _not_ for functional access control. @@ -1200,8 +1201,14 @@ class Title { } } elseif( !$user->isAllowed( $action ) ) { $return = null; - $groups = array_map( array( 'User', 'makeGroupLinkWiki' ), - User::getGroupsWithPermission( $action ) ); + + // We avoid expensive display logic for quickUserCan's and such + $groups = false; + if (!$short) { + $groups = array_map( array( 'User', 'makeGroupLinkWiki' ), + User::getGroupsWithPermission( $action ) ); + } + if( $groups ) { $return = array( 'badaccess-groups', array( implode( ', ', $groups ), count( $groups ) ) );